<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="Bookmark" href="favicon.ico">
    <link rel="Shortcut Icon" href="favicon.ico"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.9/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="static/business/css/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <!--/meta 作为公共模版分离出去-->

    <title>新增文章 - 资讯管理 - h-ui.admin.pro v1.0</title>
    <meta name="keywords" content="h-ui.admin.pro v1.0,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
    <meta name="description" content="h-ui.admin.pro v1.0，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<div class="wap-container">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">
        首页
        <span class="c-gray en">/</span>
        资讯管理
        <span class="c-gray en">/</span>
        新增资讯
        <a class="btn btn-success radius f-r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <article class="Hui-admin-content clearfix">
        <div class="panel">
            <div class="panel-body">
                <form class="form form-horizontal" id="form-article-add">
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章标题：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <input type="text" class="input-text" value="" placeholder="" id="articleTitle"
                                   name="articleTitle">
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>简略标题：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <input type="text" class="input-text" value="" placeholder="" id="articleSubTitle"
                                   name="articleSubTitle">
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>分类栏目：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
								<span class="select-box">
									<select name="articleClassify" class="select">
										<option value="" selected>全部栏目</option>
										<option value="1">新闻资讯</option>
										<option value="11">├行业动态</option>
										<option value="12">├行业资讯</option>
										<option value="13">├行业新闻</option>
									</select>
								</span>
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章类型：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
								<span class="select-box">
									<select name="articleType" class="select">
										<option value="" selected>全部类型</option>
										<option value="1">帮助说明</option>
										<option value="2">新闻资讯</option>
									</select>
								</span>
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>排序值：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <input type="text" class="input-text" value="0" placeholder="" id="articleSort"
                                   name="articleSort">
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>关键词：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <input type="text" class="input-text" value="" placeholder="" id="articleKeywords"
                                   name="articleKeywords">
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章摘要：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <textarea cols="" rows="" class="textarea textarea-article" placeholder="说点什么...最少输入10个字符"
                                      name="articleAbstract"></textarea>
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章作者：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <input type="text" class="input-text" value="0" placeholder="" id="articleAuthor"
                                   name="articleAuthor">
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章来源：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <input type="text" class="input-text" value="0" placeholder="" id="articleSource"
                                   name="articleSource">
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2">允许评论：</label>
                        <div class="form-controls col-xs-8 col-sm-9 skin-minimal">
                            <div class="check-box">
                                <input type="checkbox" id="articleComment" name="articleComment" checked>
                                <label for="articleComment">&nbsp;</label>
                            </div>
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2">评论开始日期：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <input type="text" id="comment-datetime-start" class="input-text datetimepicker-input"
                                   name="commentDatetimeStart">
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2">评论结束日期：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <input type="text" id="comment-datetime-end" class="input-text datetimepicker-input"
                                   name="commentDatetimeEnd">
                        </div>
                    </div>

                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2">缩略图：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
								<span class="btn-upload">
									<a href="javascript:void(0);" class="btn btn-primary radius btn-upload"><i
                                            class="Hui-iconfont">&#xe642;</i> 浏览文件</a>
									<input type="file" multiple name="btnUploadFileThumb" id="btn-upload-file-thumb"
                                           class="input-file">
								</span>
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2">文章内容：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <script id="articleEditor" type="text/plain" style="width:100%;height:400px;"></script>
                        </div>
                    </div>
                    <div class="row clearfix">
                        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                            <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i>
                                保存并提交审核
                            </button>
                            <button onClick="article_save();" class="btn btn-secondary radius" type="button"><i
                                    class="Hui-iconfont">&#xe632;</i> 保存草稿
                            </button>
                            <button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </article>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/3.1.1/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"></script>
<script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="static/business/js/main.js"></script>
<script type="text/javascript">
    $(function () {
        // 复选框样式
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });
        // 是否评论
        $('#articleComment').on('ifChecked', function (event) {
            $("#comment-datetime-start,#comment-datetime-end").attr("disabled", false).removeClass("disabled");
        });
        $('#articleComment').on('ifUnchecked', function (event) {
            $("#comment-datetime-start,#comment-datetime-end").attr("disabled", true).addClass("disabled");
        });

        // 设置评论日期
        $("#comment-datetime-start").datetimepicker({
            language: 'zh-CN',
            format: 'yyyy-mm-dd',
            minView: "month",
            todayBtn: 1,
            autoclose: 1,
            endDate: new Date(),
        }).on('changeDate', function (event) {
            event.preventDefault();
            event.stopPropagation();
            var startTime = event.date;
            $('#search-datetime-end').datetimepicker('setStartDate', startTime);
        });
        $("#comment-datetime-end").datetimepicker({
            language: 'zh-CN',
            format: 'yyyy-mm-dd',
            minView: "month",
            todayBtn: 1,
            autoclose: 1,
            endDate: new Date(),
        }).on('changeDate', function (event) {
            event.preventDefault();
            event.stopPropagation();
            var endTime = event.date;
            $("#search-datetime-start").datetimepicker('setEndDate', endTime);
        });

        // 文章摘要
        $(".textarea-article").Huitextarealength({
            minlength: 10,
            maxlength: 500
        });

        // 文章内容 实例化百度富文本编辑器
        var ue = UE.getEditor('articleEditor');

        // 表单提交验证
        $("#form-article-add").validate({
            rules: {
                articleTitle: {
                    required: true,
                },
                articleSubTitle: {
                    required: true,
                },
                articleClassify: {
                    required: true,
                },
                articleType: {
                    required: true,
                },
                articleSort: {
                    required: true,
                },
                articleKeywords: {
                    required: true,
                },
                articleAbstract: {
                    required: true,
                    minlength: 10,
                    maxlength: 500
                },
                articleAuthor: {
                    required: true,
                },
                articleSource: {
                    required: true,
                },
            },
            onkeyup: false,
            focusCleanup: true,
            success: "valid",
            submitHandler: function (form) {
                $(form).ajaxSubmit();
            }
        });
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
